package com.yunchang.springboot.mapper.mwsreport;

import com.yunchang.springboot.models.mwsreportbean.MwsDailyInventoryHistory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Administrator
 */
@Mapper
public interface MwsDailyInventoryHistoryMapper {
    /**
     * 根据id 删除 MwsDailyInventoryHistory
     * @param id
     * @return
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 增加 MwsDailyInventoryHistory 对象
     * @param record
     * @return
     */
    int insert(MwsDailyInventoryHistory record);

    /**
     * 有选择的增加MwsDailyInventoryHistory对象
     * @param record
     * @return
     */
    int insertSelective(MwsDailyInventoryHistory record);

    /**
     * 根据id查询MwsDailyInventoryHistory对象
     * @param id
     * @return
     */
    MwsDailyInventoryHistory selectByPrimaryKey(Integer id);

    /**
     * 根据MwsDailyInventoryHistory对象有选择的更新
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(MwsDailyInventoryHistory record);

    /**
     * 根据MwsDailyInventoryHistory对象更新
     * @param record
     * @return
     */
    int updateByPrimaryKey(MwsDailyInventoryHistory record);

    /**
     * 根据参数获取最近更新的日期
     * @param sellerId
     * @param area
     * @return
     */
    String getLatestDay(@Param("sellerId") String sellerId, @Param("area") String area);

    /**
     * 根据参数获取sku
     * @param fnSku
     * @param countryCode
     * @param sellerId
     * @param monthOfCharge
     * @return
     */
    String selectSkuByFnSkuAndCountryCodeAndSellerIdAndMonthOfCharge(String fnSku,String countryCode,String sellerId,String monthOfCharge);

    /**
     * 根据参数获取country
     * @param fulfillmentCenterId
     * @return
     */
    String getCountryByFulfillmentCenterId(String fulfillmentCenterId);

    /**
     * 根据参数获取country
     * @param requestDateStart
     * @param requestDateEnd
     * @param sellerId
     * @param sku
     * @return
     */
    List<String> getCountryByRequestDateAndSellerIdAndSku(String requestDateStart, String requestDateEnd, String sellerId, String sku);

    /**
     * 根据参数获取country
     * @param sellerId
     * @param fulfillmentCenterId
     * @return
     */
    String selectCountryBySellerIdAndFulfillmentCenterId(String sellerId,String fulfillmentCenterId);

    /**
     * 根据参数获取country
     * @param fnSku
     * @return
     */
    List<String> selectCountryByFuSku(String fnSku);

    /**
     * 根据参数获取country
     * @param fnSku
     * @param sellerId
     * @return
     */
    List<String> selectCountryByFuSkuAndSellerId(String fnSku,String sellerId);

    /**
     * 根据参数获取country
     * @param sellerId
     * @param fnSku
     * @return
     */
    List<String> selectCountryBySellerIdAndFnSku(String sellerId,String fnSku);

    /**
     * 根据参数获取country
     * @param sellerId
     * @param sku
     * @return
     */
    List<String> selectCountryBySellerIdAndSku(String sellerId,String sku);

    /**
     * 根据sellerId和 fnSku获取对应的sku
     * @param sellerId
     * @param fnSku
     * @return
     */
    String selectSkuBySellerIdAndFnSku(String sellerId,String fnSku);

    /**
     * 根据参数获取对应的参数
     * @param sellerId
     * @param sku
     * @param snapshotDate
     * @return
     */
    List<String> selectCountryBySellerIdAndSkuAndReturnDate(String sellerId,String sku,String snapshotDate);
}